# -*- mode: snippet -*-
# name: milestone rate of survfit for tidymodels/broom
# key: survfit_event_rate_milesone
# contributor: Shuguang Sun
# --
survfit_time <- function(x, ...) {
  # x from survfit
  fit <- summary(x, ...)
  # multiple rows if not single arm
  ret <- list(time = fit$time, surv = fit$surv, stderr = fit$std.err,
              surv_lower = fit$lower, surv_upper = fit$upper)
  as_tibble(ret)
}
